package com.uchedao.vehicledetection.model;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * 漆膜厚度
 *
 * @author "叶晋"
 *
 */
public class PaintThickness implements Serializable, Cloneable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Expose
	@SerializedName("name")
	public String name;// 检测部位名称

	@Expose
	@SerializedName("result")
	// 检测结果( 0-150 未发现修复,150-250 重新喷漆,250- 喷漆并有腻子)
	public ArrayList<Integer> result;

	@SerializedName("points")
	public int points;// 点数

	public int max = -1;//最大值

	// public String toString() {
	// JSONObject object = new JSONObject();
	// try {
	// object.put("name", name);
	// } catch (JSONException e) {
	// e.printStackTrace();
	// }
	// try {
	// object.put("points", points);
	// } catch (JSONException e) {
	// e.printStackTrace();
	// }
	//
	// if (result != null && result.size() > 0) {
	// JSONArray array = new JSONArray();
	// for (int i : result) {
	// array.put(i);
	// }
	// try {
	// object.put("result", array);
	// } catch (JSONException e) {
	// e.printStackTrace();
	// }
	// }
	// return object.toString();
	// }

	@Override
	public PaintThickness clone() throws CloneNotSupportedException {
		PaintThickness paint_thickness = (PaintThickness) super.clone();
		if (result != null) {
			paint_thickness.result = new ArrayList<Integer>();
			for (int i : result)
				paint_thickness.result.add(i);
		}
		return paint_thickness;
	}

}
